﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Create.aspx.cs" Inherits="Create" Title="Create New Issue" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style type="text/css">
    .style2
    {
            width: 387px;
        }
    .style3
    {
            width: 135px;
            text-align: center;
        }
        .style4
        {
            font-size: large;
            font-weight: bold;
            font-family: Georgia;
            color: #0066FF;
        }
        .style5
        {
            width: 135px;
            text-align: center;
            height: 49px;
        }
        .style6
        {
            width: 387px;
            font-family: Arial, Helvetica, sans-serif;
            font-size: large;
            color: #660033;
            font-weight: bold;
            height: 49px;
        }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <p class="style4">
        Create New Issue</p>
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
        HeaderText="Please correct these errors:" ValidationGroup="validate" />
    <asp:Label ID="lblStatus" runat="server"></asp:Label>
    <p>
        <table cellpadding="8" cellspacing="0" frame="box" >
            <tr>
                <td class="style3" bgcolor="#FFCCFF">
                    <asp:Label ID="lblCreator" runat="server" AssociatedControlID="txtCreator" 
                        Text="Creator's Name" 
                        style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtCreator" runat="server" MaxLength="20" 
                        style="background-color: #FFFFCC"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="txtCreator" ErrorMessage="Creator's Name is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style3" bgcolor="#CC99FF">
                    <asp:Label ID="lblLabel" runat="server" AssociatedControlID="txtLabel" 
                        Text="Label" style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtLabel" runat="server" style="margin-left: 0px; background-color: #FFFFCC;" 
                        Width="360px" MaxLength="128"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                        ControlToValidate="txtLabel" ErrorMessage="Label is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style3" bgcolor="#FF9966">
                    <asp:Label ID="lblCategory" runat="server" AssociatedControlID="ddlCategory" 
                        Text="Category" style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:DropDownList ID="ddlCategory" runat="server" DataSourceID="sdsCategory" 
                        DataTextField="cat_name" DataValueField="cat_id" Width="146px" 
                        style="background-color: #FFCC99">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sdsCategory" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        
                        SelectCommand="SELECT [cat_id], [cat_name] FROM [category] ORDER BY [cat_name]">
                    </asp:SqlDataSource>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                        ControlToValidate="ddlCategory" ErrorMessage="Category is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style3" bgcolor="#CCFFFF">
                    <asp:Label ID="lblPriority" runat="server" AssociatedControlID="ddlPriority" 
                        Text="Priority" style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:DropDownList ID="ddlPriority" runat="server" DataSourceID="sdsPriority" 
                        DataTextField="priority_code" DataValueField="priority_code" 
                        style="background-color: #CCFFCC">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sdsPriority" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [priority_code], [priority_rank] FROM [priority] ORDER BY [priority_rank] DESC">
                    </asp:SqlDataSource>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                        ControlToValidate="ddlPriority" ErrorMessage="Priority is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style3" bgcolor="#CCFF66">
                    <asp:Label ID="lblAssignment" runat="server" 
                        AssociatedControlID="ddlAssignment" Text="Assign To" style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:DropDownList ID="ddlAssignment" runat="server" Width="200
                    px" 
                        DataSourceID="sdsAssign" DataTextField="text" DataValueField="username" 
                        style="background-color: #CCFF99">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="sdsAssign" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT
 user_lname +  ', ' + user_fname + ' (' + UPPER(user_uname) + ')' as text,
 user_uname as username

 FROM [user] ORDER BY [user_lname], user_fname, user_uname "></asp:SqlDataSource>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                        ControlToValidate="ddlAssignment" ErrorMessage="Assign To is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style3" bgcolor="#FF99CC">
                    <asp:Label ID="lblDescription" runat="server" 
                        AssociatedControlID="txtDescription" Text="Description" style="font-family: Georgia; color: #660066"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="txtDescription" runat="server" Height="156px" 
                        TextMode="MultiLine" Width="361px" MaxLength="999" 
                        style="background-color: #FFFFCC"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                        ControlToValidate="txtDescription" ErrorMessage="Description is required." 
                        ValidationGroup="validate">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style5">
                    </td>
                <td class="style6">
                    <asp:Button ID="btnSubmit" runat="server" Text="Create" Width="69px" 
                        onclick="btnSubmit_Click" />
&nbsp;<asp:Button ID="btnClear" runat="server" Text="Reset All Fields" CausesValidation="False" 
                        onclick="btnClear_Click" />
                    <br />
                </td>
            </tr>
        </table>
    </p>
    <p>
        &nbsp;</p>
</asp:Content>

